/**
 * @file can_msg.hpp
 * @brief can信息封装类
 * @author chenhonlin (chenhonglinchl@aliyun.com)
 * @version 1.0
 * @date 2020-08-05
 * 
 * @copyright Copyright (c) 2020  XX公司
 * 
 * @par log:
 * <table>
 * <tr><th>Date       <th>Version <th>Author      <th>Description
 * <tr><td>2020-08-05 <td>1.0     <td>chenhonglin     <td>内容
 * </table>
 */
#pragma once

#include "common.hpp"

/**
 * @brief can message
 */
class can_msg
{
public:
    can_msg(){
        rt_memset(&msg, sizeof(msg), 0);
    }
    can_msg(struct rt_can_msg* m){
        rt_memcpy(&msg, m, sizeof(msg));
    }

    can_msg(const can_msg& m){
        rt_memcpy(&msg, &m.msg, sizeof(msg));
    }

    struct rt_can_msg* get_data_p(){
        return &msg;
    }

private:
    struct rt_can_msg msg;
};
